{yun:}include file="$wapstyle/member/cheader.htm"{/yun}
<style type="text/css">
header{position: fixed;width: 100%;z-index: 9}
.jam_left{float: left;width: 20%;text-align: center;border-right: 1px solid #c6c6c6;line-height: 20px;height: 53px;padding-top: 6px;}
.jam_left p{color: #0195ff}
.jam_left p,.jam_right p{margin-bottom: 0}
.jam_right{float: right;width: 80%;padding-left: 16px;}
.yun_member_bth{clear: both;}
.zw_name{color: #000;font-size: 15px;}
.com_name{color: #757474;}
.look_num{color: #9e9f9f;}
.wap_member_msg{border: none;padding: 10px 0;}
.jam_right p{line-height: 18px;}
.three{width: 35px !important;}
.mui-control-item{color: #727171 !important}
.index_jobtit .mui-active {position: relative;color: #0195ff !important;border-bottom: 1.35px solid #0195ff !important;}
</style>
<!-- <section class="wap_member"> -->
    {yun:}if $rows{/yun}
       <section class="pj_list">
    <!-- <div id="slider" class="mui-slider"> -->
        <div id="sliderSegmentedControl" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted index_jobtit" style="position: fixed;width: 100%;margin-top: 55px;z-index: 9">
            <a class="mui-control-item mui-active" href="#alllist">全部</a>
            <a class="mui-control-item " href="#shlist">进行中</a>
            <!-- <a class="mui-control-item" href="#shlist">待审核</a> -->
            <a class="mui-control-item" href="#xjlist">已结束</a>
        </div>
        
      
        
        
        <!-- <div class="mui-slider-group" style="margin-top: 100px;"> -->
            <div id="alllist" class="list_bd mui-scroll-wrapper" style="border:none;
    margin-top: 51px;">
                {yun:}if $zp>0{/yun}
                <ul class="mui-scroll">
                  
                  
                </ul>
                <div id="loadings" style="height:30px;line-height:30px; width:100%; position: fixed; bottom: 10px; z-index: 10; text-align: center; color:#666">
                    <img style="width:28px; vertical-align: middle;" src="../app/template/wap/images/loading.gif" />加载中....
                </div>
                {yun:}else{/yun}
                <div class="wap_member_no">暂无职位</div>
                {yun:}/if{/yun}
            </div>
            <script type="text/javascript">
               
                var page = 0;
                mui.init({
                  pullRefresh : {
                    container:'.list_bd',//待刷新区域标识，querySelector能定位的css选择器均可，比如：id、.class等
                    up : {
                      height:200,//可选.默认50.触发上拉加载拖动距离
                      auto:true,//可选,默认false.自动上拉加载一次
                      contentrefresh : "正在加载...",//可选，正在加载状态时，上拉加载控件上显示的标题内容
                      contentnomore:'没有更多数据了',//可选，请求完毕若没有更多数据时显示的提醒内容；
                      callback : function (){
                                $('#loadings').show();
                                var self = this;
                                page+=1; 
                                $.post('{yun:}$config.sy_weburl{/yun}/wap/member/index.php?c=ajaxjob',{
                                   page:page
                                },function(res){
                                    res = JSON.parse(res);
                                    console.log(res);

                                    if(res.length==0){ 
                                    alert(res.length)                          
                                        self.disablePullupToRefresh(); 

                                    }
                                     
                                    processorData(res);                       
                                });

                               self.endPullupToRefresh(false);
                             } //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
                    }
                  }
                });

              

               function processorData(res){

                  var htmlstr=``;

                  if(!res.toString()){

                        $('.mui-scroll').append('<li class="evaluation_item" id="tishi" style="min-height:30px;line-height:30px; width:100%;bottom: 20px;text-align: center;  color:#666; border-bottom:0;">没有数据了</li>');
                             $('#loadings').hide();
                             return false;

                  }

                    
                    for(let data of res){

                            htmlstr += `<li>
                        <div class="wap_member_msg ">
                            <div class="jam_left">
                                <p>${data.dcl}</p>
                                <p>待处理</p>
                            </div>
                            <a href="index.php?c=job_detail&id=${data.id}&type=2">
                                <div class="jam_right">
                                    <p class="zw_name">${data.name}</p>
                                    <p class="com_name">上海好聚好散有限公司</p>
                                    <p class="look_num">有${data.jobhits}人查看了该岗位</p>
                                </div>
                            </a>
                            <div class="clear"></div>
                        </div>
                         
                        <div class="yun_member_bth jam_show" >
                            <img src="../../app/template/wap/images/three.png" class="three">
                        </div>
                        <div class="yun_member_bth" style="border: none;padding-top: 0;display: none;">
                            <a href="javascript:layer_del('确定要删除？','index.php?c=jobdel&id=${data.id}');" class="yun_member_sub  ">删除</a>
                            <a href="javascript:void(0)" class="yun_member_sub  " onclick="refreshJobWap('${data.id}')')">刷新</a>
                            <a href="index.php?c=jobadd6&id=${data.id}" class="yun_member_sub ">修改</a>
                            <a href="javascript:void(0)" onclick="layer_del('','index.php?c=jobset&status=1&id=${data.id}')" class="yun_member_sub ">下架</a>
                        </div> 
                    </li>`;

                    }

                    $('#loadings').hide();
                    
                    $('.mui-scroll').append(htmlstr);

               }

            </script>

            <div id="shlist" class="mui-slider-item mui-control-content" style="border:none;display: none;">
              {yun:}if $zp>0{/yun}
                <ul>
                   
                    {yun:}foreach item=v from=$rows{/yun} 
                    {yun:}if $v.state==1 && $v.status!=1{/yun}
                    <li>
                        <div class="wap_member_msg ">
                            <div class="jam_left">
                                <p>{yun:}$v.dcl{/yun}</p>
                                <p>待处理</p>
                            </div>
                            <a href="index.php?c=job_detail">
                                <div class="jam_right">
                                    <p class="zw_name">{yun:}$v.name{/yun}</p>
                                    <p class="com_name">上海好聚好散有限公司</p>
                                    <p class="look_num">有{yun:}$v.jobhits{/yun}人查看了该岗位</p>
                                </div>
                            </a>
                            <div class="clear"></div>
                        </div>
                         
                        <div class="yun_member_bth jam_show" >
                            <img src="../../app/template/wap/images/three.png" class="three">
                        </div>
                        <div class="yun_member_bth" style="border: none;padding-top: 0;display: none;">
                            <a href="javascript:layer_del('确定要删除？','index.php?c=jobdel&id={yun:}$v.id{/yun}');" class="yun_member_sub  ">删除</a>
                            <a href="javascript:void(0)" class="yun_member_sub  " onclick="refreshJobWap('{yun:}$v.id{/yun}')">刷新</a>
                            <a href="index.php?c=jobadd6&id={yun:}$v.id{/yun}" class="yun_member_sub ">修改</a>
                            <a href="javascript:void(0)" onclick="layer_del('','index.php?c=jobset&status=1&id={yun:}$v.id{/yun}')" class="yun_member_sub ">下架</a>
                        </div> 
                    </li>
                    {yun:}/if{/yun} 
                    {yun:}/foreach{/yun}
                   
                </ul>
                {yun:}else{/yun}
                <div class="wap_member_no">暂无职位</div>
                {yun:}/if{/yun}
            </div>


            <div id="xjlist" class="mui-slider-item mui-control-content" style="border:none;display: none;">
                {yun:}if $xj>0{/yun}
                <ul>
                    {yun:}foreach item=v from=$rows{/yun} {yun:}if $v.status==1{/yun}
                    <li>
                        <div class="wap_member_msg ">
                            <div class="wap_member_date">
                                <span class="yun_m_job_date_n">&nbsp;
										<a href="{yun:}url m=wap c=job a=view id=$v.id{/yun}" class="job_list_jobname com_member_hr_cblue">{yun:}$v.name{/yun}</a>
									</span>
                                <div class="wap_member_date_r">
                                    {yun:}if $v.state==1{/yun} 已审核 {yun:}elseif $v.state==3{/yun}
                                    <span class="wap_member_wtg" onclick="layermsg('{yun:}$v.statusbody{/yun}');return false;">未通过</span> {yun:}elseif $v.state==0{/yun}
                                    <em>未审核</em> {yun:}/if{/yun}
                                </div>
                            </div>
                            <div class="yun_m_job_list_zt">
                                应聘简历：{yun:}$v.snum{/yun}
                                <span class="wap_member_msg_job_s">浏览量：{yun:}$v.jobhits{/yun} </span>
                            </div>
                            <div class="yun_m_job_list_zt">更新时间：{yun:}$v.lastupdate|date_format:"%Y-%m-%d"{/yun}</div>
                            <div class="yun_member_bth">
                                <a href="javascript:layer_del('确定要删除？','index.php?c=jobdel&id={yun:}$v.id{/yun}');" class="yun_member_sub  yun_member_bth1">删除</a>
                                <a href="index.php?c=jobadd&id={yun:}$v.id{/yun}" class="yun_member_sub yun_member_bth2">修改</a>
                                
								 {yun:}if $v.status=="1"{/yun}
									{yun:}if $statis.vip_etime< time(){/yun} 
										<a href="javascript:void(0)" onclick="layermsg('会员已到期，无法上架，请先升级会员！');return false;" class="yun_member_sub yun_member_bth3">
											<span class="yun_member_yzt">已下架</span>上架职位
										</a>
									{yun:}else{/yun}
										<a href="javascript:void(0)" onclick="layer_del('','index.php?c=jobset&status=2&id={yun:}$v.id{/yun}')" class="yun_member_sub yun_member_bth3">
											<span class="yun_member_yzt">已下架</span>上架职位
										</a>
									{yun:}/if{/yun} 
								{yun:}/if{/yun}
                            </div>
                        </div>
                    </li>
                    {yun:}/if{/yun} {yun:}/foreach{/yun}
                </ul>
                {yun:}else{/yun}
                <div class="wap_member_no">暂无职位</div>
                {yun:}/if{/yun}
            </div>
        <!-- </div> -->
    <!-- </div> -->
</section>
    <!-- </div> -->
    {yun:}else{/yun}
    <div class="wap_member_no">您还没有发布职位。
        <div>
            <a href="javascript:void(0)" onclick="jobadd_url('{yun:}$statis.addjobnum{/yun}','{yun:}$config.integral_job{/yun}','job','{yun:}$config.com_integral_online{/yun}','{yun:}$config.integral_proportion{/yun}');" class="wap_member_no_submit">发布职位</a>
        </div>
    </div>
    {yun:}/if{/yun}
<!-- </section> -->


<div style="width:100%;height:100%; background:rgba(51,51,51,0.5); position:fixed;left:0px;top:0px;z-index:1000000;display:none" id="jobserver">
    <div style="width:100%; position:absolute;left:0px;top:40px;">
        <div style=" padding:20px;">
            <div class="job_extension_tck" style="display:block">

                <div class="job_extension_tck_tit">职位推广<span onclick="$('#jobserver').hide();" style="float:right">关闭</span></div>

                <ul class="serverul">
                    <li onclick="ckserver('1');" class="server1 job_extension_tck_yse">
                        <a href="javascript:void(0)"><i class="job_extension_tck_icon "></i>自动刷新</a>
                    </li>

                    <li onclick="ckserver('2');" class="server2">
                        <a href="javascript:void(0)"><i class="job_extension_tck_icon "></i>职位置顶</a>
                    </li>

                    <li onclick="ckserver('3');" class="server3">
                        <a href="javascript:void(0)"><i class="job_extension_tck_icon "></i>推荐职位</a>
                    </li>

                    <li onclick="ckserver('4');" class="server4">
                        <a href="javascript:void(0)"><i class="job_extension_tck_icon "></i>紧急招聘</a>
                    </li>
                   
                </ul>

                <input id="server" value='1' type="hidden" />
                <input id="jobid" value='' type="hidden" />

                <div class="job_extension_tck_bth">
                    <a href="javascript:void(0)" onclick="forserver()" class="job_extension_tck_sub">确定</a>
                </div>

            </div>
        </div>
    </div>
</div>
<script>

    $('.jam_show').click(function(){
        $(this).next().toggle();
    })
    mui('.mui-scroll-wrapper').scroll();

    function showserver(id) {
        $('#jobid').val(id);
        $('#jobserver').show();
    }

    function ckserver(type) {
        $("#server").val(type);
        $(".serverul li").removeClass("job_extension_tck_yse");
        $(".server" + type).addClass("job_extension_tck_yse");
    }

    function forserver() {
        var server = $("#server").val();
        var jobid = $("#jobid").val();
        window.location.href = "index.php?c=getserver&id=" + jobid + "&server=" + server;

    }

    function refreshJobWap(jobId) {
        var weburl = '{yun:}url m=wap{/yun}';
        var integral = '{yun:}$config.integral_jobefresh{/yun}';
        var online = '{yun:}$config.com_integral_online{/yun}';
        var pro = '{yun:}$config.integral_proportion{/yun}';
        var ajaxUrl = weburl + "member/index.php?c=ajax_refresh_job";

        $.post(ajaxUrl, {
            jobid: jobId
        }, function(data) {
            data = eval('(' + data + ')');

            if(data.error == 1) {
                layermsg(data.msg, 2, 9, function() {
                    window.location.href = '';
                });
            } else if(data.error == 2) {
                if(online == 3) {
                    layer.open({
                        content: "您的等级特权已用完，继续操作将消费" + integral * pro + "积分，是否继续？",
                        btn: ['继续', '取消'],
                        shadeClose: false,
                        yes: function() {
                            window.location.href = "index.php?c=getserver&id=" + jobId + "&server=" + 5;;
                        }
                    });
                } else {
                    layer.open({
                        content: "您的等级特权已用完，继续操作将消费" + integral + "元，是否继续？",
                        btn: ['继续', '取消'],
                        shadeClose: false,
                        yes: function() {
                            window.location.href = "index.php?c=getserver&id=" + jobId + "&server=" + 5;;
                        }
                    });
                }

            } else {
                if(data.url) {
                    layermsg(data.msg, 2, function() {
                        location.href = "index.php?c={yun:}if $config.com_vip_type==2||$config.com_vip_type==0{/yun}rating{yun:}else{/yun}time{yun:}/if{/yun}"
                    });
                } else {
                    layermsg(data.msg, 2, 8);
                }
            }

        });
    }
	 
</script>

{yun:}include file="$wapstyle/footer.htm"{/yun}